//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS MedicalImaging service.
///
/// This is the AWS HealthImaging API Reference. For an introduction to the service, see What is AWS HealthImaging? in the AWS HealthImaging Developer Guide.
public struct MedicalImaging: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the MedicalImaging client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "MedicalImaging",
            serviceIdentifier: "medical-imaging",
            serviceProtocol: .restjson,
            apiVersion: "2023-07-19",
            endpoint: endpoint,
            errorType: MedicalImagingErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Copy an image set.
    @Sendable
    @inlinable
    public func copyImageSet(_ input: CopyImageSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CopyImageSetResponse {
        try await self.client.execute(
            operation: "CopyImageSet", 
            path: "/datastore/{datastoreId}/imageSet/{sourceImageSetId}/copyImageSet", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Copy an image set.
    ///
    /// Parameters:
    ///   - copyImageSetInformation: Copy image set information.
    ///   - datastoreId: The data store identifier.
    ///   - force: Providing this parameter will force completion of the CopyImageSet operation, even if there are inconsistent Patient, Study, and/or Series level metadata elements between the sourceImageSet and destinationImageSet.
    ///   - promoteToPrimary: Providing this parameter will configure the CopyImageSet operation to promote the given image set to the primary DICOM hierarchy. If successful, a new primary image set ID will be returned as the destination image set.
    ///   - sourceImageSetId: The source image set identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func copyImageSet(
        copyImageSetInformation: CopyImageSetInformation,
        datastoreId: String,
        force: Bool? = nil,
        promoteToPrimary: Bool? = nil,
        sourceImageSetId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CopyImageSetResponse {
        let input = CopyImageSetRequest(
            copyImageSetInformation: copyImageSetInformation, 
            datastoreId: datastoreId, 
            force: force, 
            promoteToPrimary: promoteToPrimary, 
            sourceImageSetId: sourceImageSetId
        )
        return try await self.copyImageSet(input, logger: logger)
    }

    /// Create a data store.
    @Sendable
    @inlinable
    public func createDatastore(_ input: CreateDatastoreRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDatastoreResponse {
        try await self.client.execute(
            operation: "CreateDatastore", 
            path: "/datastore", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a data store.
    ///
    /// Parameters:
    ///   - clientToken: A unique identifier for API idempotency.
    ///   - datastoreName: The data store name.
    ///   - kmsKeyArn: The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) key for accessing encrypted data.
    ///   - tags: The tags provided when creating a data store.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDatastore(
        clientToken: String = CreateDatastoreRequest.idempotencyToken(),
        datastoreName: String? = nil,
        kmsKeyArn: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDatastoreResponse {
        let input = CreateDatastoreRequest(
            clientToken: clientToken, 
            datastoreName: datastoreName, 
            kmsKeyArn: kmsKeyArn, 
            tags: tags
        )
        return try await self.createDatastore(input, logger: logger)
    }

    /// Delete a data store.  Before a data store can be deleted, you must first delete all image sets within it.
    @Sendable
    @inlinable
    public func deleteDatastore(_ input: DeleteDatastoreRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteDatastoreResponse {
        try await self.client.execute(
            operation: "DeleteDatastore", 
            path: "/datastore/{datastoreId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a data store.  Before a data store can be deleted, you must first delete all image sets within it.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDatastore(
        datastoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteDatastoreResponse {
        let input = DeleteDatastoreRequest(
            datastoreId: datastoreId
        )
        return try await self.deleteDatastore(input, logger: logger)
    }

    /// Delete an image set.
    @Sendable
    @inlinable
    public func deleteImageSet(_ input: DeleteImageSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteImageSetResponse {
        try await self.client.execute(
            operation: "DeleteImageSet", 
            path: "/datastore/{datastoreId}/imageSet/{imageSetId}/deleteImageSet", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Delete an image set.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - imageSetId: The image set identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteImageSet(
        datastoreId: String,
        imageSetId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteImageSetResponse {
        let input = DeleteImageSetRequest(
            datastoreId: datastoreId, 
            imageSetId: imageSetId
        )
        return try await self.deleteImageSet(input, logger: logger)
    }

    /// Get the import job properties to learn more about the job or job progress.  The jobStatus refers to the execution of the import job. Therefore, an import job can return a jobStatus as COMPLETED even if validation issues are discovered during the import process. If a jobStatus returns as COMPLETED, we still recommend you review the output manifests written to S3, as they provide details on the success or failure of individual P10 object imports.
    @Sendable
    @inlinable
    public func getDICOMImportJob(_ input: GetDICOMImportJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDICOMImportJobResponse {
        try await self.client.execute(
            operation: "GetDICOMImportJob", 
            path: "/getDICOMImportJob/datastore/{datastoreId}/job/{jobId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get the import job properties to learn more about the job or job progress.  The jobStatus refers to the execution of the import job. Therefore, an import job can return a jobStatus as COMPLETED even if validation issues are discovered during the import process. If a jobStatus returns as COMPLETED, we still recommend you review the output manifests written to S3, as they provide details on the success or failure of individual P10 object imports.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - jobId: The import job identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDICOMImportJob(
        datastoreId: String,
        jobId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDICOMImportJobResponse {
        let input = GetDICOMImportJobRequest(
            datastoreId: datastoreId, 
            jobId: jobId
        )
        return try await self.getDICOMImportJob(input, logger: logger)
    }

    /// Get data store properties.
    @Sendable
    @inlinable
    public func getDatastore(_ input: GetDatastoreRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDatastoreResponse {
        try await self.client.execute(
            operation: "GetDatastore", 
            path: "/datastore/{datastoreId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get data store properties.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDatastore(
        datastoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDatastoreResponse {
        let input = GetDatastoreRequest(
            datastoreId: datastoreId
        )
        return try await self.getDatastore(input, logger: logger)
    }

    /// Get an image frame (pixel data) for an image set.
    @Sendable
    @inlinable
    public func getImageFrame(_ input: GetImageFrameRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetImageFrameResponse {
        try await self.client.execute(
            operation: "GetImageFrame", 
            path: "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageFrame", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Get an image frame (pixel data) for an image set.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - imageFrameInformation: Information about the image frame (pixel data) identifier.
    ///   - imageSetId: The image set identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getImageFrame(
        datastoreId: String,
        imageFrameInformation: ImageFrameInformation,
        imageSetId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetImageFrameResponse {
        let input = GetImageFrameRequest(
            datastoreId: datastoreId, 
            imageFrameInformation: imageFrameInformation, 
            imageSetId: imageSetId
        )
        return try await self.getImageFrame(input, logger: logger)
    }

    /// Get image set properties.
    @Sendable
    @inlinable
    public func getImageSet(_ input: GetImageSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetImageSetResponse {
        try await self.client.execute(
            operation: "GetImageSet", 
            path: "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSet", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Get image set properties.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - imageSetId: The image set identifier.
    ///   - versionId: The image set version identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getImageSet(
        datastoreId: String,
        imageSetId: String,
        versionId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetImageSetResponse {
        let input = GetImageSetRequest(
            datastoreId: datastoreId, 
            imageSetId: imageSetId, 
            versionId: versionId
        )
        return try await self.getImageSet(input, logger: logger)
    }

    /// Get metadata attributes for an image set.
    @Sendable
    @inlinable
    public func getImageSetMetadata(_ input: GetImageSetMetadataRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetImageSetMetadataResponse {
        try await self.client.execute(
            operation: "GetImageSetMetadata", 
            path: "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSetMetadata", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Get metadata attributes for an image set.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - imageSetId: The image set identifier.
    ///   - versionId: The image set version identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getImageSetMetadata(
        datastoreId: String,
        imageSetId: String,
        versionId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetImageSetMetadataResponse {
        let input = GetImageSetMetadataRequest(
            datastoreId: datastoreId, 
            imageSetId: imageSetId, 
            versionId: versionId
        )
        return try await self.getImageSetMetadata(input, logger: logger)
    }

    /// List import jobs created for a specific data store.
    @Sendable
    @inlinable
    public func listDICOMImportJobs(_ input: ListDICOMImportJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDICOMImportJobsResponse {
        try await self.client.execute(
            operation: "ListDICOMImportJobs", 
            path: "/listDICOMImportJobs/datastore/{datastoreId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List import jobs created for a specific data store.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - jobStatus: The filters for listing import jobs based on status.
    ///   - maxResults: The max results count. The upper bound is determined by load testing.
    ///   - nextToken: The pagination token used to request the list of import jobs on the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDICOMImportJobs(
        datastoreId: String,
        jobStatus: JobStatus? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDICOMImportJobsResponse {
        let input = ListDICOMImportJobsRequest(
            datastoreId: datastoreId, 
            jobStatus: jobStatus, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDICOMImportJobs(input, logger: logger)
    }

    /// List data stores.
    @Sendable
    @inlinable
    public func listDatastores(_ input: ListDatastoresRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDatastoresResponse {
        try await self.client.execute(
            operation: "ListDatastores", 
            path: "/datastore", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List data stores.
    ///
    /// Parameters:
    ///   - datastoreStatus: The data store status.
    ///   - maxResults: Valid Range: Minimum value of 1. Maximum value of 50.
    ///   - nextToken: The pagination token used to request the list of data stores on the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listDatastores(
        datastoreStatus: DatastoreStatus? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDatastoresResponse {
        let input = ListDatastoresRequest(
            datastoreStatus: datastoreStatus, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDatastores(input, logger: logger)
    }

    /// List image set versions.
    @Sendable
    @inlinable
    public func listImageSetVersions(_ input: ListImageSetVersionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListImageSetVersionsResponse {
        try await self.client.execute(
            operation: "ListImageSetVersions", 
            path: "/datastore/{datastoreId}/imageSet/{imageSetId}/listImageSetVersions", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// List image set versions.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - imageSetId: The image set identifier.
    ///   - maxResults: The max results count.
    ///   - nextToken: The pagination token used to request the list of image set versions on the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listImageSetVersions(
        datastoreId: String,
        imageSetId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListImageSetVersionsResponse {
        let input = ListImageSetVersionsRequest(
            datastoreId: datastoreId, 
            imageSetId: imageSetId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listImageSetVersions(input, logger: logger)
    }

    /// Lists all tags associated with a medical imaging resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all tags associated with a medical imaging resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the medical imaging resource to list tags for.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Search image sets based on defined input attributes.   SearchImageSets accepts a single search query parameter and returns a paginated response of all image sets that have the matching criteria. All date range queries must be input as (lowerBound, upperBound). By default, SearchImageSets uses the updatedAt field for sorting in descending order from newest to oldest.
    @Sendable
    @inlinable
    public func searchImageSets(_ input: SearchImageSetsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SearchImageSetsResponse {
        try await self.client.execute(
            operation: "SearchImageSets", 
            path: "/datastore/{datastoreId}/searchImageSets", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Search image sets based on defined input attributes.   SearchImageSets accepts a single search query parameter and returns a paginated response of all image sets that have the matching criteria. All date range queries must be input as (lowerBound, upperBound). By default, SearchImageSets uses the updatedAt field for sorting in descending order from newest to oldest.
    ///
    /// Parameters:
    ///   - datastoreId: The identifier of the data store where the image sets reside.
    ///   - maxResults: The maximum number of results that can be returned in a search.
    ///   - nextToken: The token used for pagination of results returned in the response. Use the token returned from the previous request to continue results where the previous request ended.
    ///   - searchCriteria: The search criteria that filters by applying a maximum of 1 item to SearchByAttribute.
    ///   - logger: Logger use during operation
    @inlinable
    public func searchImageSets(
        datastoreId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        searchCriteria: SearchCriteria? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SearchImageSetsResponse {
        let input = SearchImageSetsRequest(
            datastoreId: datastoreId, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            searchCriteria: searchCriteria
        )
        return try await self.searchImageSets(input, logger: logger)
    }

    /// Start importing bulk data into an ACTIVE data store. The import job imports DICOM P10 files found in the S3 prefix specified by the inputS3Uri parameter. The import job stores processing results in the file specified by the outputS3Uri parameter.
    @Sendable
    @inlinable
    public func startDICOMImportJob(_ input: StartDICOMImportJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartDICOMImportJobResponse {
        try await self.client.execute(
            operation: "StartDICOMImportJob", 
            path: "/startDICOMImportJob/datastore/{datastoreId}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Start importing bulk data into an ACTIVE data store. The import job imports DICOM P10 files found in the S3 prefix specified by the inputS3Uri parameter. The import job stores processing results in the file specified by the outputS3Uri parameter.
    ///
    /// Parameters:
    ///   - clientToken: A unique identifier for API idempotency.
    ///   - dataAccessRoleArn: The Amazon Resource Name (ARN) of the IAM role that grants permission to access medical imaging resources.
    ///   - datastoreId: The data store identifier.
    ///   - inputOwnerAccountId: The account ID of the source S3 bucket owner.
    ///   - inputS3Uri: The input prefix path for the S3 bucket that contains the DICOM files to be imported.
    ///   - jobName: The import job name.
    ///   - outputS3Uri: The output prefix of the S3 bucket to upload the results of the DICOM import job.
    ///   - logger: Logger use during operation
    @inlinable
    public func startDICOMImportJob(
        clientToken: String = StartDICOMImportJobRequest.idempotencyToken(),
        dataAccessRoleArn: String,
        datastoreId: String,
        inputOwnerAccountId: String? = nil,
        inputS3Uri: String,
        jobName: String? = nil,
        outputS3Uri: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartDICOMImportJobResponse {
        let input = StartDICOMImportJobRequest(
            clientToken: clientToken, 
            dataAccessRoleArn: dataAccessRoleArn, 
            datastoreId: datastoreId, 
            inputOwnerAccountId: inputOwnerAccountId, 
            inputS3Uri: inputS3Uri, 
            jobName: jobName, 
            outputS3Uri: outputS3Uri
        )
        return try await self.startDICOMImportJob(input, logger: logger)
    }

    /// Adds a user-specifed key and value tag to a medical imaging resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds a user-specifed key and value tag to a medical imaging resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the medical imaging resource that tags are being added to.
    ///   - tags: The user-specified key and value tag pairs added to a medical imaging resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from a medical imaging resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from a medical imaging resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the medical imaging resource that tags are being removed from.
    ///   - tagKeys: The keys for the tags to be removed from the medical imaging resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Update image set metadata attributes.
    @Sendable
    @inlinable
    public func updateImageSetMetadata(_ input: UpdateImageSetMetadataRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateImageSetMetadataResponse {
        try await self.client.execute(
            operation: "UpdateImageSetMetadata", 
            path: "/datastore/{datastoreId}/imageSet/{imageSetId}/updateImageSetMetadata", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            hostPrefix: "runtime-", 
            logger: logger
        )
    }
    /// Update image set metadata attributes.
    ///
    /// Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - force: Setting this flag will force the UpdateImageSetMetadata operation for the following attributes:    Tag.StudyInstanceUID, Tag.SeriesInstanceUID, Tag.SOPInstanceUID, and Tag.StudyID    Adding, removing, or updating private tags for an individual SOP Instance
    ///   - imageSetId: The image set identifier.
    ///   - latestVersionId: The latest image set version identifier.
    ///   - updateImageSetMetadataUpdates: Update image set metadata updates.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateImageSetMetadata(
        datastoreId: String,
        force: Bool? = nil,
        imageSetId: String,
        latestVersionId: String,
        updateImageSetMetadataUpdates: MetadataUpdates,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateImageSetMetadataResponse {
        let input = UpdateImageSetMetadataRequest(
            datastoreId: datastoreId, 
            force: force, 
            imageSetId: imageSetId, 
            latestVersionId: latestVersionId, 
            updateImageSetMetadataUpdates: updateImageSetMetadataUpdates
        )
        return try await self.updateImageSetMetadata(input, logger: logger)
    }
}

extension MedicalImaging {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: MedicalImaging, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MedicalImaging {
    /// Return PaginatorSequence for operation ``listDICOMImportJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDICOMImportJobsPaginator(
        _ input: ListDICOMImportJobsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDICOMImportJobsRequest, ListDICOMImportJobsResponse> {
        return .init(
            input: input,
            command: self.listDICOMImportJobs,
            inputKey: \ListDICOMImportJobsRequest.nextToken,
            outputKey: \ListDICOMImportJobsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDICOMImportJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - jobStatus: The filters for listing import jobs based on status.
    ///   - maxResults: The max results count. The upper bound is determined by load testing.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDICOMImportJobsPaginator(
        datastoreId: String,
        jobStatus: JobStatus? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDICOMImportJobsRequest, ListDICOMImportJobsResponse> {
        let input = ListDICOMImportJobsRequest(
            datastoreId: datastoreId, 
            jobStatus: jobStatus, 
            maxResults: maxResults
        )
        return self.listDICOMImportJobsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDatastores(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDatastoresPaginator(
        _ input: ListDatastoresRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDatastoresRequest, ListDatastoresResponse> {
        return .init(
            input: input,
            command: self.listDatastores,
            inputKey: \ListDatastoresRequest.nextToken,
            outputKey: \ListDatastoresResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDatastores(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreStatus: The data store status.
    ///   - maxResults: Valid Range: Minimum value of 1. Maximum value of 50.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDatastoresPaginator(
        datastoreStatus: DatastoreStatus? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDatastoresRequest, ListDatastoresResponse> {
        let input = ListDatastoresRequest(
            datastoreStatus: datastoreStatus, 
            maxResults: maxResults
        )
        return self.listDatastoresPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listImageSetVersions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listImageSetVersionsPaginator(
        _ input: ListImageSetVersionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListImageSetVersionsRequest, ListImageSetVersionsResponse> {
        return .init(
            input: input,
            command: self.listImageSetVersions,
            inputKey: \ListImageSetVersionsRequest.nextToken,
            outputKey: \ListImageSetVersionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listImageSetVersions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The data store identifier.
    ///   - imageSetId: The image set identifier.
    ///   - maxResults: The max results count.
    ///   - logger: Logger used for logging
    @inlinable
    public func listImageSetVersionsPaginator(
        datastoreId: String,
        imageSetId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListImageSetVersionsRequest, ListImageSetVersionsResponse> {
        let input = ListImageSetVersionsRequest(
            datastoreId: datastoreId, 
            imageSetId: imageSetId, 
            maxResults: maxResults
        )
        return self.listImageSetVersionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``searchImageSets(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func searchImageSetsPaginator(
        _ input: SearchImageSetsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<SearchImageSetsRequest, SearchImageSetsResponse> {
        return .init(
            input: input,
            command: self.searchImageSets,
            inputKey: \SearchImageSetsRequest.nextToken,
            outputKey: \SearchImageSetsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``searchImageSets(_:logger:)``.
    ///
    /// - Parameters:
    ///   - datastoreId: The identifier of the data store where the image sets reside.
    ///   - maxResults: The maximum number of results that can be returned in a search.
    ///   - searchCriteria: The search criteria that filters by applying a maximum of 1 item to SearchByAttribute.
    ///   - logger: Logger used for logging
    @inlinable
    public func searchImageSetsPaginator(
        datastoreId: String,
        maxResults: Int? = nil,
        searchCriteria: SearchCriteria? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<SearchImageSetsRequest, SearchImageSetsResponse> {
        let input = SearchImageSetsRequest(
            datastoreId: datastoreId, 
            maxResults: maxResults, 
            searchCriteria: searchCriteria
        )
        return self.searchImageSetsPaginator(input, logger: logger)
    }
}

extension MedicalImaging.ListDICOMImportJobsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MedicalImaging.ListDICOMImportJobsRequest {
        return .init(
            datastoreId: self.datastoreId,
            jobStatus: self.jobStatus,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MedicalImaging.ListDatastoresRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MedicalImaging.ListDatastoresRequest {
        return .init(
            datastoreStatus: self.datastoreStatus,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MedicalImaging.ListImageSetVersionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MedicalImaging.ListImageSetVersionsRequest {
        return .init(
            datastoreId: self.datastoreId,
            imageSetId: self.imageSetId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MedicalImaging.SearchImageSetsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MedicalImaging.SearchImageSetsRequest {
        return .init(
            datastoreId: self.datastoreId,
            maxResults: self.maxResults,
            nextToken: token,
            searchCriteria: self.searchCriteria
        )
    }
}
